package com.cmw.auntapp.adapter;

import java.util.List;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

/**
 * @desc:
 * @author: chengmingwei
 * @date: 2021/8/27 7:09 AM
 * @contact: phone(微信同号):13922111489 / email: 340360491@qq.com
 */
public class CommonFragmentPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> list;

    public CommonFragmentPagerAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list != null ? list.size() : 0;
    }
}
